package com.cn.aam.checaiduo.ui.me;

import android.content.Context;
import android.content.Intent;
import android.support.v4.content.ContextCompat;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.widget.TextView;

import com.cn.aam.checaiduo.R;
import com.cn.aam.checaiduo.base.BaseActivity;
import com.cn.aam.checaiduo.base.ToolBarManager;

import butterknife.BindView;

/**
 * monker on 2017/6/27.
 * 积分攻略
 */

public class PointIntroduceActivity extends BaseActivity {
    @BindView(R.id.induce_tv_two)
    TextView induceTvTwo;
    @BindView(R.id.induce_tv_three)
    TextView induceTvThree;
    @BindView(R.id.induce_tv_four)
    TextView induceTvFour;

    public static Intent newInstance(Context context) {
        Intent intent = new Intent(context, PointIntroduceActivity.class);
        return intent;
    }

    @Override
    protected int layoutId() {
        return R.layout.activity_point_introduce;
    }

    @Override
    protected void initView() {
        ToolBarManager.with(this, WMContent)
                .setTitle("积分攻略")
                .setTitleColor(R.color.textColor)
                .setBackground(R.color.gray_background)
                .setNavigationIcon(R.drawable.ic_nav_arrow_back);


        //ForegroundColorSpan 为文字前景色，BackgroundColorSpan为文字背景色
        ForegroundColorSpan span = new ForegroundColorSpan(ContextCompat.getColor(mContext, R.color.textColorMinor));

        SpannableString text1 = new SpannableString("2.投资获得积分：投资额/100");
        text1.setSpan(span, 9, text1.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
        induceTvTwo.setText(text1);

        SpannableString text2 = new SpannableString("3.签到获得积分：每天签到可获得1积分");
        text2.setSpan(span, 9, text2.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
        induceTvThree.setText(text2);

        SpannableString text3 = new SpannableString("4.积分活动：根据具体活动规则来计算积分，赠送的积分由平台客服手动添加。");
        text3.setSpan(span, 7, text3.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
        induceTvFour.setText(text3);
    }
}
